﻿<Window x:Class="devtm.Editor.Configuration.Merge.ChangeFrm"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ChangeFrm" Height="361" Width="740" WindowStartupLocation="CenterScreen"
        xmlns:Selector="clr-namespace:devtm.Editor.Configuration.Merge"
        >

    <Window.Resources>

        

        <DataTemplate DataType="{x:Type Selector:DiffItemAdded}">
            
            <Grid Margin="10" HorizontalAlignment="Stretch">
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <Grid Grid.Column="0" Margin="20">
                    
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <Button Grid.Column="0" Content="  Add section  " DataContext="{Binding .}" Margin="10" Click="SectionAdd" />
                    <Button Grid.Column="1" Content="  Skip  "        DataContext="{Binding .}" Margin="10" Click="Skip" />
                    
                </Grid>

                <Grid Grid.Column="1" Margin="20" DataContext="{Binding Right}">

                    <TextBlock Text="{Binding Text}"  />
                        
                </Grid>
                
            </Grid>
        </DataTemplate>

        <DataTemplate DataType="{x:Type Selector:DiffItemDeleted}">

            <Grid Margin="10" HorizontalAlignment="Stretch">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Grid Grid.Column="0" Margin="20">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <Button Grid.Column="0" DataContext="{Binding .}" Content="  Remove this section  " Margin="10" Click="SectionRemove" />
                    <Button Grid.Column="1" DataContext="{Binding .}" Content="  Skip  "     Margin="10" Click="Skip" />

                </Grid>

                <Grid Grid.Column="1" Margin="20" DataContext="{Binding Left}">

                    <TextBlock Text="{Binding Text}"  />

                </Grid>

            </Grid>
        </DataTemplate>

        <DataTemplate DataType="{x:Type Selector:DiffItemUpdated}">

            <Grid Margin="10" HorizontalAlignment="Stretch">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Grid Grid.Column="0" Margin="20" >
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="45" />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" DataContext="{Binding Left}" Text="{Binding Text}" />
                    <Button Grid.Row="1" Content="  Select your version  " Margin="10" Click="SectionGet" DataContext="{Binding .}" Tag="{Binding Left}" />
                </Grid>

                <Grid Grid.Column="1" Margin="20" >
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="45" />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" DataContext="{Binding Right}" Text="{Binding Text}" />
                    <Button Grid.Row="1" Content="  Select the new version  " Margin="10" Click="SectionGet" DataContext="{Binding .}" Tag="{Binding Right}" />
                </Grid>

            </Grid>
        
        </DataTemplate>
        
    </Window.Resources>
    
    <Grid>
        
        <ListBox 
            HorizontalAlignment="Stretch" 
            ItemsSource="{Binding .}"
            Margin="10,10,0,0" 
            Name="listBox1" 
            VerticalAlignment="Stretch"
            />
        
    </Grid>
</Window>
